package com.rd.student.jiaji.class4.suyan.zrrd.Exam;

import java.util.Objects;

public class Student {
    private int chinasum;
    private int mathsum;
    private String name;
    private int sum;

    public Student() {
    }

    public Student(String name, int chinasum, int mathsum, int sum) {
        this.chinasum = chinasum;
        this.mathsum = mathsum;
        this.name = name;
        this.sum = sum;
    }

    public int getChinasum() {
        return chinasum;
    }

    public void setChinasum(int chinasum) {
        this.chinasum = chinasum;
    }

    public int getMathsum() {
        return mathsum;
    }

    public void setMathsum(int mathsum) {
        this.mathsum = mathsum;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    @Override
    public String toString() {
        return name+" "+chinasum+" "+mathsum+" "+sum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return chinasum == student.chinasum && mathsum == student.mathsum && sum == student.sum && Objects.equals(name, student.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(chinasum, mathsum, name, sum);
    }
}
